package com.lagou.servlet;

import com.lagou.pojo.Request;
import com.lagou.pojo.Response;

public abstract class HttpServlet implements Servlet {

    @Override
    public void init() throws Exception {
        
    }

    @Override
    public void start() throws Exception {

    }

    @Override
    public void destroy() throws Exception {

    }

    @Override
    public void service(Request request, Response response) throws Exception {
        if("GET".equalsIgnoreCase(request.getMethod())){
            doGet(request, response);
        } else if("POST".equalsIgnoreCase(request.getMethod())){
            doPost(request, response);
        }
    }
    
    public abstract void doGet(Request request, Response response) throws Exception;
    
    public abstract void doPost(Request request, Response response) throws Exception;
}
